<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Explore Trusted Information & Timely Updates at InfotoPlaza</title>
    <meta name="keywords" content="Health, Auto, Lifestyle, Travel, Fashion, Auto, InfotoPlaza">
    <meta name="description" content="Get expert information on health, technology, business, and more at InfotoPlaza. Stay informed with reliable updates on what matters most.">
    <link href="
    https://cdn.jsdelivr.net/npm/layui@2.9.16/dist/css/layui.min.css
    " rel="stylesheet">
    <link href="
https://cdn.jsdelivr.net/npm/layui@2.9.16/dist/css/layui.min.css
" rel="stylesheet">
<link rel="shortcut icon" href="https://infotoplaza.com/information/assets/favicon.ico">

    <link rel="stylesheet" href="https://infotoplaza.com/information/css/reset.css">
    <link rel="stylesheet" href="https://infotoplaza.com/information/css/public.css">
    <link rel="stylesheet" href="https://infotoplaza.com/information/category/index.css">

</head>

<body>
    <header class="header">
        <div class="wrap">
            <div class="main-header">
                <div class="menuBtn">
                    <img src="https://infotoplaza.com/information/assets/menu.png" alt>
                </div>
                <nav class="nav" aria-label="Site Menu">
                    <h2>
                        <a class="logo-is-image logo-link" href="https://infotoplaza.com/information/" rel="home"
                            title="Infotoplaza">
                            
                                <img alt="Infotoplaza" class="logo-image"
                                    src="https://infotoplaza.com/information/assets/logo.jpg"
                                    srcset="https://infotoplaza.com/information/assets/logo.jpg ../assets/logo.jpg 2x">
                            
                        </a>
                    </h2>
                    <ul id="menu-primary-menu-english" class="nav__list">
                        <li id="menu-item-125" class="menu-item">
                            <a class="nav__link" target="_parent"
                                href="https://infotoplaza.com/information/category/travel/">Travel</a>
                        </li>
                        <li id="menu-item-125" class="menu-item">
                            <a class="nav__link" target="_parent"
                                href="https://infotoplaza.com/information/category/health/">Health</a>
                        </li>
                        <li id="menu-item-125" class="menu-item">
                            <a class="nav__link" target="_parent"
                                href="https://infotoplaza.com/information/category/lifeStyle/">Lifestyle</a>
                        </li>
                        <li id="menu-item-125" class="menu-item">
                            <a class="nav__link" target="_parent"
                                href="https://infotoplaza.com/information/category/finance/">Finance</a>
                        </li>
                        <li id="menu-item-125" class="menu-item">
                            <a class="nav__link" target="_parent"
                                href="https://infotoplaza.com/information/category/auto/">Auto</a>
                        </li>
                        <li id="menu-item-125" class="menu-item">
                            <a class="nav__link" target="_parent"
                                href="https://infotoplaza.com/information/category/fashion/">Fashion</a>
                        </li>
                    </ul>
                </nav>
                <nav class="mobileNav">
                    <div class="navContent">
                        <img src="https://infotoplaza.com/information/assets/close.png" alt class="closeBtn">
                        <a class="logo-is-image logo-link" href="https://infotoplaza.com/information/" rel="home"
                            title="Infotoplaza">
                            <h1>
                                <img alt="Infotoplaza" class="logo-image"
                                    src="https://infotoplaza.com/information/assets/logo.jpg"
                                    srcset="https://infotoplaza.com/information/assets/logo.jpg ../assets/logo.jpg 2x">
                            </h1>
                        </a>
                        <ul id="menu-primary-menu-english" class="nav__list">
                            <li id="menu-item-125" class="menu-item">
                                <a class="nav__link" target="_parent"
                                    href="https://infotoplaza.com/information/category/travel/">Travel</a>
                            </li>
                            <li id="menu-item-125" class="menu-item">
                                <a class="nav__link" target="_parent"
                                    href="https://infotoplaza.com/information/category/health/">Health</a>
                            </li>
                            <li id="menu-item-125" class="menu-item">
                                <a class="nav__link" target="_parent"
                                    href="https://infotoplaza.com/information/category/lifeStyle/">Lifestyle</a>
                            </li>
                            <li id="menu-item-125" class="menu-item">
                                <a class="nav__link" target="_parent"
                                    href="https://infotoplaza.com/information/category/finance/">Finance</a>
                            </li>
                            <li id="menu-item-125" class="menu-item">
                                <a class="nav__link" target="_parent"
                                    href="https://infotoplaza.com/information/category/auto/">Auto</a>
                            </li>
                            <li id="menu-item-125" class="menu-item">
                                <a class="nav__link" target="_parent"
                                    href="https://infotoplaza.com/information/category/fashion/">Fashion</a>
                            </li>
                        </ul>
                    </div>
                </nav>
                <div class="navMask"></div>

                <div class="searchBox">
                    <input type="text" placeholder="Search..." class="layui-input">
                    <img src="https://infotoplaza.com/information/assets/Search.png" alt="" class="searchIcon">
                    
                </div>
            </div>

        </div>

    </header>
    <ul class="breadCrumb wrap">
        <li class="type-name">
            <a href="https://infotoplaza.com/information/">Home</a>
        </li>
        <li class="type-name category_name">
           <a href="#">Search</a>
        </li>
    </ul>

    <main class="content_main wrap">
        <section class="articleList">
            <h1 class="keyWords">
                Browsing:
                <span class="typeName">
                    FASHION
                </span>
            </h1>
           <div class="articleBox"></div>
            <!-- 分页器 -->
            <div class="pageBox">
                <div id="demo-laypage-pn-hide"></div>
            </div>
        </section>
        <div class="aside">
            <section class="relatedPosts">
            </section>
            <div class="AFC">
                AD
            </div>
        </div>
    </main>

    <footer class="copyRight">
        <div class="wrap">
            <ul class="links">
                <li><a href="https://infotoplaza.com/information/">Home</a></li>
                <li><a href="https://infotoplaza.com/information/copyRight/aboutUs/">ABOUT US</a></li>
                <li><a href="https://infotoplaza.com/information/copyRight/term_of_us/">TERMS OF USE</a></li>
                <li><a href="https://infotoplaza.com/information/copyRight/privacy_policy/">PRIVACY POLICY</a></li>
                <li><a href="https://infotoplaza.com/information/copyRight/contactUs/">CONTACT US</a></li>
            </ul>
            <br>
            <br>
            <p>
                © 2024  InfotoPlaza.com
            </p>
            <br>
            <strong>Disclaimer</strong>
            <br>
            <div class="descption">
                The content available on this website, including text, graphics, images, and information, is provided
                only for general informational purposes. The materials and details on these pages, along with any terms,
                conditions, or descriptions, are subject to change without prior notice.
            </div>
        </div>
    </footer>

    <script src="
    https://cdn.jsdelivr.net/npm/layui@2.9.16/dist/layui.min.js
    "></script>

    <script src="../utils/jquery.js"></script>


    <script type="module">
        import {articleData, getAllUrlParams} from '../utils/common.js'

        let todaysArr = []
        for(let i in articleData){
            for(let j in articleData[i]){
                if(articleData[i][j].isTodays){
                    todaysArr.push(articleData[i][j])
                }
            }
        }

        let keyWords = getAllUrlParams().key
        $('.keyWords').html(`Search results for —— ${keyWords}`)

        console.log(getAllUrlParams());
        
        let searchResultList = []
        for (let i in articleData) {
            for (let j in articleData[i]) {
                for (let m in articleData[i][j]) {
                    if (m !== 'id') {
                        if (articleData[i][j][m].includes(keyWords)) {
                            searchResultList.push(articleData[i][j])
                            break
                        }
                    }
                }
            }
        }

        let str = `  <h1>
                Search results for 
                <span class="typeName">
                    "${keyWords}"
                </span>
            </h1>`
        let postStr = ''
        
        let pageStr = searchResultList.length > 10 ? `<div id="demo-laypage-pn-hide"></div>`: ``
        $('.pageBox').html(pageStr)
            
        function getArticleStr(arr,current=1) {
            let postStr = ''
            if(arr.length <= 10){
            arr.map(item =>{
            postStr += `   <article class="posts">
                <div class="media">
                    <a class="imgBox" href="https://infotoplaza.com/information/detail/${item.classfy}/${item.articleName}" title="${item.newsTitle}">
                        <div class="bgImg bgBox7 lazyloaded"
                            data-bgset="${item.imgUrl} 300w, ${item.imgUrl} 750w, ${item.imgUrl} 768w, ${item.imgUrl} 150w, ${item.imgUrl} 450w, ${item.imgUrl} 1000w"
                            data-bgsrc="${item.imgUrl}"
                            data-sizes="(max-width: 291px) 100vw, 291px" data-loaded="1"
                            style="background-image: url(&quot;${item.imgUrl}&quot;);">
                        </div>
                    </a>

                    <div class="typeBtn">
                        <a href="../${item.classfy}/index.html">
                                ${item.classfy === 'other' ? item.realClassfy.toUpperCase() : item.classfy.toUpperCase()}
                        </a>
                    </div>
                </div>
                <div class="contentText">
                    <h2>
                        <a href="https://infotoplaza.com/information/detail/${item.classfy}/${item.articleName}">
                        ${item.newsTitle}
                        </a>
                    </h2>
                    <div class="publicTime">
                        By
                        <a href="#" class="author">
                        ${item.author} —
                        </a>
                        <time datetime="${item.publicTime}">${item.publicTime}</time>
                    </div>
                    <p class="desc">
                        ${item.seoText}
                    </p>
                </div>
            </article>`
        })
        }else{
            arr.slice((current - 1)*10, current * 10).map(item =>{
            postStr += `   <article class="posts">
                <div class="media">
                    <a class="imgBox" href="https://infotoplaza.com/information/detail/${item.classfy}/${item.articleName}" title="${item.newsTitle}">
                        <div class="bgImg bgBox7 lazyloaded"
                            data-bgset="${item.imgUrl} 300w, ${item.imgUrl} 750w, ${item.imgUrl} 768w, ${item.imgUrl} 150w, ${item.imgUrl} 450w, ${item.imgUrl} 1000w"
                            data-bgsrc="${item.imgUrl}"
                            data-sizes="(max-width: 291px) 100vw, 291px" data-loaded="1"
                            style="background-image: url(&quot;${item.imgUrl}&quot;);">
                        </div>
                    </a>

                    <div class="typeBtn">
                        <a href="../${item.classfy}/index.html">
                                ${item.classfy.toUpperCase()}
                        </a>
                    </div>
                </div>
                <div class="contentText">
                    <h2>
                        <a href="https://infotoplaza.com/information/detail/${item.classfy}/${item.articleName}">
                        ${item.newsTitle}
                        </a>
                    </h2>
                    <div class="publicTime">
                        By
                        <a href="#" class="author">
                        ${item.author} —
                        </a>
                        <time datetime="${item.publicTime}">${item.publicTime}</time>
                    </div>
                    <p class="desc">
                        ${item.seoText}
                    </p>
                </div>
            </article>`
        })
        }
            return postStr
        }
        
        $('.articleBox').html(getArticleStr(searchResultList))
        layui.use(function () {
            var laypage = layui.laypage;
            // 不显示上一页、下一页
            laypage.render({
                elem: 'demo-laypage-pn-hide',
                count: searchResultList.length,
                prev: false,
                next: false,
                jump: function (obj, first) {
                    $('.articleBox').html(getArticleStr(searchResultList,obj.curr))
                    console.log(obj.curr); // 得到当前页，以便向服务端请求对应页的数据。
                    console.log(obj.limit); // 得到每页显示的条数

                    // 首次不执行
                    if (!first) {
                        // do something
                    }
                }
            });
        });

        // 今日推荐
        let todaysList = todaysArr
        let relatedStr = `<div class="categoryTitle">
                    <h2 class="heading">
                        Related Articles
                    </h2>
                </div>`
        todaysList.map(item =>{
            relatedStr +=  `  <article class="post subPosts">
                    <div class="media">
                        <a href="https://infotoplaza.com/information/detail/${item.classfy}/${item.articleName}" title="${item.newsTitle}">
                            <div class="bgImg bgBox4 lazyloaded"
                                data-bgset="${item.imgUrl} 300w, ${item.imgUrl} 707w, ${item.imgUrl} 768w, ${item.imgUrl} 150w, ${item.imgUrl} 450w, ${item.imgUrl} 1000w"
                                data-bgsrc="${item.imgUrl}"
                                data-sizes="(max-width: 135px) 100vw, 135px"
                                style="background-image: url(&quot;${item.imgUrl}&quot;);">
                            </div>
                        </a>
                    </div>
                    <div class="postsText">
                        <h4 class="postsTitle">
                            <a href="https://infotoplaza.com/information/detail/${item.classfy}/${item.articleName}">
                                <a href="https://infotoplaza.com/information/detail/${item.classfy}/${item.articleName}">
                                   ${item.newsTitle}
                                </a>
                            </a>
                        </h4>
                          <time datetime="${item.publicTime}">${item.publicTime}</time>
                    </div>
                </article>`
        })
        
        $('.relatedPosts').html(relatedStr)

     
        let befortop = 0;
        //监听滚动条事件
        function callBack() {
            let aftertop = document.documentElement ? document.documentElement.scrollTop : document.body.scrollTop;//兼容
            if (aftertop - befortop > 0) {
                document.querySelector('.header').style.marginTop = '-60px'
                console.log('向下');
            } else {
                if (aftertop >= 50) {
                    document.querySelector('.header').style.marginTop = '-3px'
                }
                console.log('向上');
            }
            befortop = aftertop;
        }

        let timeout = null,
            startTime = Date.parse(new Date); // 开始时间
        window.addEventListener('scroll', function () {
            if (timeout !== null) clearTimeout(timeout);
            let curTime = Date.parse(new Date); // 当前时间
            if (curTime - startTime >= 1000) { // 时间差>=1秒直接执行
                callBack();
                startTime = curTime;
            } else { // 否则延时执行，像滚动了一下，差值<1秒的那种也要执行
                timeout = setTimeout(callBack(), 300);
            }
        });

        const input = document.querySelector('.layui-input')
        input.onkeyup = function (event) {
        let e = event || window.event;
        if (e && e.keyCode == 13) { //回车键的键值为13
            location.href = `https://infotoplaza.com/information/search/?key=` + input.value
        }
        }
        $('.menuBtn').on('click', function () {
            $('.mobileNav').css('transform', 'translateX(0)');
            $('.navMask').css('opacity', '1');
            $('.navMask').css('z-index', '1');
            $('.navMask').css('display', 'block');
        })
        $('.closeBtn').on('click', function () {
            $('.mobileNav').css('transform', 'translateX(-100%)');
            $('.navMask').css('opacity', '0');
            $('.navMask').css('z-index', '-1');
            $('.navMask').css('display', 'none');
        })


    </script>
</body>

</html>